package com.bjpower.convent;

import com.bjpower.domain.PayProduct;
import com.bjpower.models.vo.ProductPageVo;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.MappingConstants;
import org.mapstruct.Mappings;

import java.util.List;

@Mapper(componentModel = MappingConstants.ComponentModel.SPRING, uses = {MapperHelder.class})
public interface ProductVoConvent {
    @Mappings({@Mapping(source = "productCode",target = "productCode"),
               @Mapping(source = "productName",target = "productName"),
               @Mapping(source = "status",target = "status", qualifiedByName = "statusConvent"),
                @Mapping(source = "editTime",target = "editTime", dateFormat = "yyyy-MM-dd HH:mm:ss")})
    ProductPageVo toProductPageVo(PayProduct payProduct);

    List<ProductPageVo> toProductPageVoList(List<PayProduct> payProductList);
}
